package com.rustic.server.enums;

import cn.xy.commons.validator.VerifiedEnum;
import lombok.Getter;

/**
 * 分类类型枚举
 */

@Getter
public enum CategoryType implements VerifiedEnum {

    /**
     * 活动类型
     */
    ACTIVITY(1, "活动类型"),

    /**
     * 景点等级
     */
    ATTRACTION_GRADE(2, "景点等级"),

    /**
     * 景点类型
     */
    ATTRACTION_TYPE(3, "景点类型"),

    /**
     * 美食分类
     */
    FOOD(4, "美食分类"),

    /**
     * 攻略分类
     */
    STRATEGY(5, "攻略分类");

    private final int value;

    private final String name;

    CategoryType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public static CategoryType toCategoryType(int value) {
        for (CategoryType category : CategoryType.values()) {
            if (category.getValue() == value) {
                return category;
            }
        }
        throw new IllegalArgumentException("Invalid Category Value: " + value);
    }


    @Override
    public Object getVerifiedValue() {
        return this.value;
    }
}
